﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Diagnostics;
using System.ComponentModel;
using WPFExcelReport.Helpers;
using System.Windows.Input;
namespace WPFExcelReport
{
    public partial class TSWT06
    {
        public TSWT06()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWTEINZ();
            this.DataContext = MV;
            InitializeComponent();
        }
        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsLoaded)
                return;
            LOADALL();
            base.Window_Loaded(sender, e);
        }
        public void LOADALL()
        {
            dwData = TBMain.NewRow();
            dwData["WTEMANDANT"] = app.Mandant;
            SResult = TMV.QWTEINZ02(dwData);
            MergeData(SResult, false);
        }
        public override void LOADBYAUF()
        {
            Locate("KEY", ORDERNUM);
        }
        public override void ManageCommand(object sender, RoutedEventArgs e)
        {
            if (IsManage)
            {
                LOADALL();
            }
            else
            {
                VICC_WFEVENTS.SVWF.SWT06(RUNID, KEY);

            }
            base.ManageCommand(sender, e);
        }

    }
}
